dojo.provide("com.ibm.sherpa.FisheyeList");

dojo.require("dojox.widget.FisheyeList");

dojo.declare(
	"com.ibm.sherpa.FisheyeList", dojox.widget.FisheyeList,{
		_onMouseMove : function(/*Event*/ e){
			this._initializePositioning();
			this.inherited(arguments);
		},
		
		_setItemSize: function(p, scale){
			var newWidth = Math.round(this.itemWidth  + ((this.itemMaxWidth  - this.itemWidth ) * (scale * this.timerScale)));
			if(this.selectedChild && (this.selectedChild == this.children[p])){
				//console.debug('selectedItemWidth=' + this.selectedItemWidth +',w='+w + ',scale=' + scale + ',timerScale='+this.timerScale);
				if((newWidth + 20) < this.selectedItemWidth){
					dojo.removeClass(this.selectedChild.numNode,'qnum-big');
					//console.debug('remove big font class');
				}else if((newWidth -10)  > this.selectedItemWidth){
					dojo.addClass(this.selectedChild.numNode,'qnum-big');
				}
				this.selectedItemWidth = newWidth;
			}
			this.inherited(arguments);
		}
	}
);


dojo.declare(
	"com.ibm.sherpa.FisheyeListItem", dojox.widget.FisheyeListItem,{
		templateString:
			'<div class="dojoxFisheyeListItem">' +
			'  <img class="dojoxFisheyeListItemImage qaicon" dojoAttachPoint="imgNode" dojoAttachEvent="onmouseover:onMouseOver,onmouseout:onMouseOut,onclick:onClick" /><div tabindex=1 dojoAttachPoint="numNode" class="qanum">1</div>' +
			'  <div class="dojoxFisheyeListItemLabel" dojoAttachPoint="lblNode"></div>' +
			'</div>',
			
			
		onMouseOver: function(/*Event*/ e){
			this.parent.selectedChild = this;
			//console.debug('set activated child='+ this.id);
			this.inherited(arguments);
		}
	}
);